﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // not use feature do post bak
        //if (!IsPostBack)
        //{
            Router();
        //}
    }

    public void Router() {
        string Page = Request.QueryString["Page"];
        Control C = new Control();
        if (Page != null)
        {
            switch (Page.ToLower())
            {
                case "home":
                    C = LoadControl("Ctr_Dynamic/Home.ascx");
                    MainContainer.Controls.Add(C);
                    break;
                case "roomhome":
                    C = LoadControl("Ctr_Dynamic/Room/Home.ascx");
                    MainContainer.Controls.Add(C);
                    break;
                case "orderroom":
                    C = LoadControl("Ctr_Dynamic/Room/Order_room.ascx");
                    MainContainer.Controls.Add(C);
                    break;
                default:
                    C = LoadControl("Ctr_Dynamic/Home.ascx");
                    MainContainer.Controls.Add(C);
                    break;
            }
        }
        else
        {
            C = LoadControl("Ctr_Dynamic/Home.ascx");
            MainContainer.Controls.Add(C);
        }
    }
}